from flask import g, request
import requests
from functools import wraps
from utils import restful


def check_status(func):
    @wraps(func)
    def check(*args, **kwargs):
        if g.user.status == 1:
            return func(*args, **kwargs)
        else:
            return restful.params_error(message='请先去激活账户')
    return check

